package com.xbongbong.pro.actionsetting.pojo;

import com.alibaba.fastjson.JSONObject;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * @author 吴峰
 * @date 2021/03/04 19:07
 */
@Getter
@Setter
@ToString
public class LowCodeActionSettingPojo implements Serializable {


    private static final long serialVersionUID = -257661128871441260L;

    private Long id;

    /**
     * 1:表单；2：字段级别
     */
    private Integer type;
    /**
     * 唯一标识，低代码使用
     */
    private String uniquelyId;

    /**
     * 1:值改变；2：表单页面被展示时（onFromMounted ）；3：表单提交前（*数据校验前 可阻断表单提交）（beforeFromSubmit ）；4：表单提交后（afterFromSubmit ）
     */
    private Integer triggerTiming;

    /**
     * @see com.xbongbong.pro.enums.lowcode.LowCodeActionTypeEnum
     */
    private Integer actionType;

    private String attr;

    private Integer fieldType;


    /**
     * 参数设置
     */
    private JSONObject param;

    /**
     * 排序
     */
    private Integer sort;

    public LowCodeActionSettingPojo() {
    }


    public LowCodeActionSettingPojo(Long id, String uniquelyId, Integer type, Integer triggerTiming, Integer actionType, String attr, Integer fieldType, JSONObject param, Integer sort) {
        this.id = id;
        this.uniquelyId = uniquelyId;
        this.type = type;
        this.triggerTiming = triggerTiming;
        this.actionType = actionType;
        this.attr = attr;
        this.fieldType = fieldType;
        this.param = param;
        this.sort = sort;
    }

    public LowCodeActionSettingPojo(Long id, Integer type, Integer triggerTiming, Integer actionType, String attr, Integer fieldType,  JSONObject param, Integer sort) {
        this.id = id;
        this.type = type;
        this.triggerTiming = triggerTiming;
        this.actionType = actionType;
        this.attr = attr;
        this.fieldType = fieldType;
        this.param = param;
        this.sort = sort;
    }
}
